<?php include "../../config.php";?>
<?php include "../../coresection/connection.php";?>
<?php include "../../coresection/checkSession.php";?>
<?php include "../../coresection/order-list.php";?>
<?php include "../../coresection/month-count.php";?>
<?php include "../../coresection/month-user-list-select.php";?>


<?
$department_list=select_lines_all_items($table_Prefix."department","","","");

//include_once("select_datas.php");




?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php include '../../modules/head.php'; ?>





</head>

<body>
<?php include '../../modules/topbar.php'; ?>

<div class="setup_area">
    <?include '../../modules/sidebar-admin.php'?>

    <div class="header">
        <h1>餐费统计


        </h1>
        <?php include '../../modules/header.php'; ?>
    </div>


    <div class="content_area">



<div class="main">


    <form action="admin_statistics_countor_meal.php" method="post" autocomplete="off" enctype="multipart/form-data" class="layui-form statistics-box">

        <style>

            .statistics-box .layui-form-label{ width: 80px;}
            .layui-form-item{ float: left;clear: none;  width: 350px;}
        </style>


        <div class="layui-form-item">
            <label class="layui-form-label">用户名：</label>
            <div class="layui-input-block">
                <input type="text" name="select_keywords" placeholder="可搜索姓名" autocomplete="off" class="layui-input" value="<? echo $_REQUEST['select_keywords']?>" >
            </div>
        </div>


            <div class="layui-form-item">
                <label class="layui-form-label"> 部门：</label>
                <div class="layui-input-block">
           <select name="depart" class="depart" >
                <?if(($_REQUEST['depart'])&&($_REQUEST['depart'])!='all'){echo "<option value='".$_REQUEST['depart']."'>".$_REQUEST['depart']."</option>";}?>
                <option value="all">全部</option>
                <? for($n=0;$n<count($department_list);$n++){ ?>
                    <option value="<?echo $department_list[$n]['name']?>"><?echo $department_list[$n]['name']?></option>
                <? } ?>
            </select>
                </div>
                </div>
<!--            姓名：<select name="selectName" class="selectName">-->
<!--                <option value="all">全部</option>-->
<!--                --><?// for($u=0;$u<count($admin_user_name);$u++){ ?>
<!--                    <option   value="--><?//echo $admin_user_name[$u]?><!--" data-dapart="--><?//echo $admin_department[$u]?><!--">--><?//echo $admin_user_name[$u]?><!--</option>-->
<!--                --><?// } ?>
<!--            </select>  <br />-->
<!--            <div style="margin-top: 10px; height: 1px;"></div>-->
<!--            就餐时间：<select name="year">-->
<!--                <option value="--><?//echo date("Y",time())?><!--">--><?//echo date("Y",time())?><!--</option>-->
<!--                <option value="--><?//echo date("Y",time())-1?><!--">--><?//echo date("Y",time())-1?><!--</option>-->
<!--            </select>-->
<!--            年-->
<!--            <select name="month">-->
<!--                --><?//if($_REQUEST['month']){echo "<option value='".$_REQUEST['month']."'>".$_REQUEST['month']."</option>";}?>
<!--                <option value="--><?// echo date(m)?><!--" >--><?// echo date(m)?><!--</option>-->
<!--                <option value="01" class="month_1">01</option>-->
<!--                <option value="02" class="month_2">02</option>-->
<!--                <option value="03" class="month_3">03</option>-->
<!--                <option value="04" class="month_4">04</option>-->
<!--                <option value="05" class="month_5">05</option>-->
<!--                <option value="06" class="month_6">06</option>-->
<!--                <option value="07" class="month_7">07</option>-->
<!--                <option value="08" class="month_8">08</option>-->
<!--                <option value="09" class="month_9">09</option>-->
<!--                <option value="10" class="month_10">10</option>-->
<!--                <option value="11" class="month_11">11</option>-->
<!--                <option value="12" class="month_12">12</option>-->
<!--            </select>-->
<!--            月-->
<!--            <select name="days">-->
<!--                --><?//if($_REQUEST['days']){echo "<option value='".$_REQUEST['days']."'>".$_REQUEST['days']."</option>";}?>
<!--                --><?//if($_REQUEST['days']=='0'){echo "<option value='0'>全部</option>";}?>
<!--                <option value="--><?// echo date(d)?><!--" >--><?// echo date(d)?><!--</option>-->
<!--                <option value="0">全部</option>-->
<!--                <option value="01">01</option><option value="02">02</option><option value="03">03</option>-->
<!--                <option value="04">04</option><option value="05">05</option><option value="06">06</option>-->
<!--                <option value="07">07</option><option value="08">08</option><option value="09">09</option>-->
<!--                <option value="10">10</option><option value="11">11</option><option value="12">12</option>-->
<!--                <option value="13">13</option><option value="14">14</option><option value="15">15</option>-->
<!--                <option value="16">16</option><option value="17">17</option><option value="18">18</option>-->
<!--                <option value="19">19</option><option value="20">20</option><option value="21">21</option>-->
<!--                <option value="22">22</option><option value="23">23</option><option value="24">24</option>-->
<!--                <option value="25">25</option><option value="26">26</option><option value="27">27</option>-->
<!--                <option value="28">28</option><option value="29">29</option><option value="30">30</option>-->
<!--                <option value="31">31</option>-->
<!--            </select>-->
<!--            日-->
<!--            <select name="ats">-->
<!--                <option value="0">全部</option>-->
<!--                <option value="1">早</option>-->
<!--                <option value="2">午</option>-->
<!--                <option value="3">晚</option>-->
<!--            </select>-->
<!--            餐-->




            <div class="layui-form-item">
                <label class="layui-form-label">报名时间：</label>

                <div class="layui-input-block">
                    <input type="text" name="select_startday" placeholder="请输入开始时间" autocomplete="off" class="layui-input"  onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" style="float: left; width: 112px" value="<?if($_REQUEST['select_startday']){echo $_REQUEST['select_startday'] ;} ?>" >

                    <span style="float: left;margin: 0 4px; line-height: 30px;">-</span>


                    <input type="text" name="select_endday" placeholder="请输入结束时间" autocomplete="off" class="layui-input" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})"  style="float: left; width:112px" value="<?if($_REQUEST['select_endday']){echo $_REQUEST['select_endday'] ;} ?>"  >


                    <br class="clearfloat" style="margin:15px 0; "/>


                </div>


            </div>

            <br class="clearfloat" style="margin:15px 0; "/>


            <input type="submit" value="查看" class="layui-btn dingdantongji_btn" />
            <input name="print" type="button" id="bt" value="点击打印" class="layui-btn" onclick="print_btn('div_print')"/>

        </form>

    <br class="clearfloat" style="margin:15px 0; "/>








        <div class="printArea <?if($_SESSION['userterm']==1){?>caiwuShow<?}?>"   id="div_print" >
            <style>
                body table {
                    border:1px solid ;
                    width: 100%;
                }
                body table td {
                    border: 1px solid;
                    text-align: center;
                }
            </style>

        <ul class="caise"></ul>


        <table cellspacing="0" cellpadding="0" border="0" class="checkTable layui-table admin_list_table">
            <colgroup>
                <col width="50px"/>
                <col width="80px;"/>
                <col width="180px;"/>
                <col/>
                <col/>
                <col/>
                <col/>
                <col/>
                <col/>
                <col/>
            </colgroup>
            <thead>
            <tr> 
                <td>卡号</td>
                <td>姓名</td> 
                <td>部门</td>
                <td>早餐数</td>
                <td>早餐金额</td>
                <td>午餐数</td>
                <td>午餐金额</td>
                <td>晚餐数</td>
                <td>晚餐金额</td>
                <td>合计金额</td>   
            </tr>
			
			<tr> 
                <td> </td>
                <td> </td> 
                <td>合计：</td>
                <td><? echo $zaocan_num_totals ?> </td>
                <td><? echo $zaocan_cost_total?></td>
                <td><? echo $wucan_num_totals ?> </td>
                <td><? echo $wucan_cost_total?></td>
                <td><? echo $wancan_num_totals ?></td>
                <td><? echo $wancan_cost_total?></td>
                <td><? echo $wancan_cost_total+$wucan_cost_total+$zaocan_cost_total ?></td>
               
            </tr>
			
			
            </thead>
            <tbody>

             
      
	  <?
//	  $endcount=$nowpageid*20;
//	  if($endcount>$sum)
//	  {$endcount=$sum;}
	  ?>
	  
<!--            --><?// for($_i=($nowpageid-1)*20;$_i<$endcount;$_i++){?>
            <? for($_i=0;$_i<$sum;$_i++){?>
                <tr >
                    <td><? echo $admin_user_id[$_i] ?></td>
                    <td><? echo $admin_user_name[$_i] ?></td> 
                    <td><? echo $admin_user_department[$_i] ?></td>
                    <td><? echo $admin_user_zaocan_count[$_i] ?></td>
                    <td><? echo $admin_user_zaocan_cost[$_i] ?></td>

                    <td><? echo $admin_user_wucan_count[$_i] ?></td>
                    <td><? echo $admin_user_wucan_cost[$_i] ?></td>
                    <td><? echo $admin_user_wancan_count[$_i] ?></td>
                    <td><? echo $admin_user_wancan_cost[$_i] ?></td>
                   
                 
					 <td><? echo $admin_user_zaocan_cost[$_i]+$admin_user_wucan_cost[$_i]+$admin_user_wancan_cost[$_i] ?></td>
                   
                 
                </tr>
            <? ;} ?>



            </tbody>
        </table>
		
		
		<div style="display: none">
		<div class="page-guide">
<? $url="admin_statistics_countor_meal.php" ?>
		
    <?php
    if ($nowpageid == 1) {
        ?>
        <!--现在页数在第一页的时候-->
        <span>首页</span>
        <span> 上一页 </span>
        <!--现在页数非第一页的时候-->
    <?php
    } else {
        ?>
        <!--现在页数非第一页的时候-->
        <a href="
		
		 <?  
            echo $url."?nowpageid=";
            echo 1;


			echo "&&year=";
            echo $count_year;
			
			echo "&&month=";
            echo $count_month;
          ?>
		  ">
		  首页 </a>
		  
		  
		  

        <a href="
		
		 <?  
            echo $url."?nowpageid=";
            echo $prepage;


			echo "&&year=";
            echo $count_year;
			
			echo "&&month=";
            echo $count_month;
          ?>
		  ">
		  上一页 </a>


        <!--现在页数非第一页的时候-->
    <?php
    }
    ?>




    <!--开始列印出所有页码-->
    <div class="pages_num">
    <?php
    $ii = 1; //用来和总页数比较。当等于总页数的时候就会停止循环
    $iii = 1;


    //如果存在省略页面的情况，就输出省略号
    if (($ii + 3) < $nowpageid) {
        echo "<span class='ell'>...</span>";
    }

    while ($ii <= $page_count) {
        //首先判断是不是当前页

        if ($ii == $nowpageid) {
            echo "<span>" . $ii . "</span>";
        } //和当前页数相差3页的页码不显示。目的是为了防止页码过多。
        else if ((($ii + 3) < $nowpageid) || (($ii - 3) > $nowpageid)) {
        } else {
            echo "<a href='";
            echo $url;

            echo "?nowpageid=";
            echo $iii;


			echo "&&year=";
            echo $count_year;
			
			echo "&&month=";
            echo $count_month;
		 
			
			
            echo "'>";
            echo $iii;
            echo "</a>";
        }

        $ii++;
        $iii++;
    }
    ?>

    <!--列印出所有页码 结束-->


    <?
    //如果存在省略页面的情况，就输出省略号

    if (($ii - 3) > $nowpageid) {
        echo "<span class='ell'>...</span>";
    }
    ?>
    </div>

    <?php
    if ($nowpageid == $page_count) {
        ?>
        <!--现在页数在第一页的时候-->
        <span> 下一页 </span>
        <span>末页</span>
        <!--现在页数非第一页的时候-->
    <?php
    } else {
        ?>
        <!--现在页数非第一页的时候-->

         <a href="
		
		 <?  
            echo $url."?nowpageid=";
            echo $nextpage;


			echo "&&year=";
            echo $count_year;
			
			echo "&&month=";
            echo $count_month;
          ?>
		  ">
		  下一页 </a>
		  
		  
         <a href="
		
		 <?  
            echo $url."?nowpageid=";
            echo $lastpage;


			echo "&&year=";
            echo $count_year;
			
			echo "&&month=";
            echo $count_month;
          ?>
		  ">
		  末页 </a>
		  
		   
        <!--现在页数非第一页的时候-->
    <?php
    }
    ?>


</div>
<!--翻页代码结束--></div>
    </div>
</div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />


<?php include '../../modules/footer.php'; ?>
</body>
</html>
